import { getSocketMessage, setMessageStatus } from "libs/api/app"


export const UPDATE_MESSAGE = "UPDATE_MESSAGE"
export const ADD_MESSAGE = "ADD_MESSAGE"

export function updateMessage(query) {
  return async (dispatch) => {
    let {data} = await getSocketMessage(query)
    dispatch({
      type: UPDATE_MESSAGE,
      data
    })
  }
}

export function setMessage(ids, query) {
  return async (dispatch) => {
    // await setMessageStatus(ids)
    // let data = read(await getSocketMessage(query), "data.content") || []
    // dispatch({
    //   type: UPDATE_MESSAGE,
    //   data
    // })
  }
}